<?php

namespace app\web\model;

use think\Db;
use think\Model;

class LotterytypeModel extends Model
{

    // 设置数据表（不含前缀）
    protected $name = 'lottery_type';

    public function __construct($data = [])
    {
        parent::__construct($data);
        $this->_collection = Db::name($this->name);
    }

    public function lottery()
    {
        $result = $this->_collection->where("enable",1)->field("id,title,showName,imgurl")->select();
        return $result;
    }
}